Check if object is accepted or rejected for a filter string

Hello!

I want to show all objects in a module, but set a flag in a LayoutDXL when an objects wouldn't be accepted (shown) if the filter is active.

I.e. I have the filter string

string myFilterString=(BB_Type == Requirement) AND (BB_Variant_NG == released)

and my object is

obj."BB_Type" = "Information", obj."BB_Variant_NG" = deferred ----> display("rejected");

obj."BB_Type" = "Requirement", obj."BB_Variant_NG" = released ----> display("accepted");

 

Is there a method like

bool checkIfObjectIsAppliedToFilterString(obj, myFilterString)

?

With best regards,
Bjoern


 


Bjoern_Karpenstein - Wed Sep 30 08:31:39 EDT 2015

Re: Check if object is accepted or rejected for a filter string
llandale - Wed Sep 30 10:27:20 EDT 2015

Maybe I'm out to lunch here and someone will correct me; but I have had no luck parsing the filter string, although I think one of the really clever folks here did it years ago.

[1] Not your question, but if you turn on filtering you can ask if the object is seen or not:

  • current = m
  • filtering on
  • for o in entire m do
  • {  if (isVisible(o)) then o is accepted in the filter
  • }

[2] The following is clumsy but should work.

Write an attr-DXL that 'violates' its own context rules:

  • Module m = module(obj)
  • Object ocurrent = m
  • bool IsFiltering = filtering(m)
  • filtering on
  • for o in entire m do
  • {  if (isVisible(o)) //
  •    then o.attrDXLName = "accepted"
  •    else o.attrDXLName = "rejected"
  • }
  • filtering (IsFiltering)   // restore original filtering setting

Notice that all values are calculated when any is calculated

Put that attr-DXL in a column and refresh DXL Attributes.

-Louie